<?php echo $this->render('header.phtml'); ?>
<?php echo $this->render('menu.phtml'); ?>

<div id="contenido">
<h2><?php echo $this->escape($this->subtitle); ?></h2>

<?php if ($this->usuarioLogueado): ?>
    <p><a href="<?php echo $this->baseUrl; ?>/faqs/faqs/agregar">Agregar faq</a></p>
<?php endif; ?>

    <table>
    <tr>
        <th>fecha</th>
         <th>pregunta</th>
         <th>respuesta</th>

    <?php if ($this->usuarioLogueado): ?>
         <th colspan="3">Acciones</th>
    <?php endif; ?>

    </tr>
    <?php
    foreach( $this->faqs as $faq ) : ?>
            <tr>
                <td nowrap><?php echo $this->escape($faq->fecha);?></td>
                <td><?php echo $this->escape($faq->pregunta);?></td>
                <td><?php echo $this->escape($faq->respuesta);?></td>

                <?php if ($this->usuarioLogueado): ?>
                    <td><a href="<?php echo $this->baseUrl; ?>/faqs/faqs/ver/id/<?php echo $faq->id;?>">Ver</a></td>
                    <td><a href="<?php echo $this->baseUrl; ?>/faqs/faqs/modificar/id/<?php echo $faq->id;?>">Modificar</a></td>
                    <td><a href="<?php echo $this->baseUrl; ?>/faqs/faqs/eliminar/id/<?php echo $faq->id;?>">Eliminar</a></td>
                <?php endif; ?>

            </tr>
    <?php endforeach; ?>
    </table>

<?php if ($this->usuarioLogueado): ?>
    <p><a href="<?php echo $this->baseUrl; ?>/faqs/faqs/agregar">Agregar faq</a></p>
<?php endif; ?>

</div>

<?php echo $this->render('footer.phtml'); ?>
